/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.ExpressionType;
import org.openapitools.client.model.State;
import org.openapitools.client.model.TargetingExpressionPredicate;

/**
 * NegativeTargetingClauseEx
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class NegativeTargetingClauseEx {
  public static final String SERIALIZED_NAME_TARGET_ID = "targetId";
  @SerializedName(SERIALIZED_NAME_TARGET_ID)
  private BigDecimal targetId;

  public static final String SERIALIZED_NAME_CAMPAIGN_ID = "campaignId";
  @SerializedName(SERIALIZED_NAME_CAMPAIGN_ID)
  private BigDecimal campaignId;

  public static final String SERIALIZED_NAME_AD_GROUP_ID = "adGroupId";
  @SerializedName(SERIALIZED_NAME_AD_GROUP_ID)
  private BigDecimal adGroupId;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  private State state;

  public static final String SERIALIZED_NAME_EXPRESSION = "expression";
  @SerializedName(SERIALIZED_NAME_EXPRESSION)
  private List<TargetingExpressionPredicate> expression = null;

  public static final String SERIALIZED_NAME_RESOLVED_EXPRESSION = "resolvedExpression";
  @SerializedName(SERIALIZED_NAME_RESOLVED_EXPRESSION)
  private List<TargetingExpressionPredicate> resolvedExpression = null;

  public static final String SERIALIZED_NAME_EXPRESSION_TYPE = "expressionType";
  @SerializedName(SERIALIZED_NAME_EXPRESSION_TYPE)
  private ExpressionType expressionType;

  public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate";
  @SerializedName(SERIALIZED_NAME_CREATION_DATE)
  private BigDecimal creationDate;

  public static final String SERIALIZED_NAME_LAST_UPDATED_DATE = "lastUpdatedDate";
  @SerializedName(SERIALIZED_NAME_LAST_UPDATED_DATE)
  private BigDecimal lastUpdatedDate;

  /**
   * The computed status of the negative targeting clause. See the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) for more information.
   */
  @JsonAdapter(ServingStatusEnum.Adapter.class)
  public enum ServingStatusEnum {
    TARGETING_CLAUSE_ARCHIVED("TARGETING_CLAUSE_ARCHIVED"),
    
    TARGETING_CLAUSE_PAUSED("TARGETING_CLAUSE_PAUSED"),
    
    TARGETING_CLAUSE_STATUS_LIVE("TARGETING_CLAUSE_STATUS_LIVE"),
    
    TARGETING_CLAUSE_POLICING_SUSPENDED("TARGETING_CLAUSE_POLICING_SUSPENDED"),
    
    CAMPAIGN_OUT_OF_BUDGET("CAMPAIGN_OUT_OF_BUDGET"),
    
    AD_GROUP_PAUSED("AD_GROUP_PAUSED"),
    
    AD_GROUP_ARCHIVED("AD_GROUP_ARCHIVED"),
    
    CAMPAIGN_PAUSED("CAMPAIGN_PAUSED"),
    
    CAMPAIGN_ARCHIVED("CAMPAIGN_ARCHIVED"),
    
    ACCOUNT_OUT_OF_BUDGET("ACCOUNT_OUT_OF_BUDGET"),
    
    PENDING_START_DATE("PENDING_START_DATE");

    private String value;

    ServingStatusEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static ServingStatusEnum fromValue(String value) {
      for (ServingStatusEnum b : ServingStatusEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<ServingStatusEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final ServingStatusEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public ServingStatusEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return ServingStatusEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_SERVING_STATUS = "servingStatus";
  @SerializedName(SERIALIZED_NAME_SERVING_STATUS)
  private ServingStatusEnum servingStatus;


  public NegativeTargetingClauseEx targetId(BigDecimal targetId) {
    
    this.targetId = targetId;
    return this;
  }

   /**
   * The negative target identifier.
   * @return targetId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The negative target identifier.")

  public BigDecimal getTargetId() {
    return targetId;
  }


  public void setTargetId(BigDecimal targetId) {
    this.targetId = targetId;
  }


  public NegativeTargetingClauseEx campaignId(BigDecimal campaignId) {
    
    this.campaignId = campaignId;
    return this;
  }

   /**
   * The identifier of the campaign to which this negative target is associated.
   * @return campaignId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The identifier of the campaign to which this negative target is associated.")

  public BigDecimal getCampaignId() {
    return campaignId;
  }


  public void setCampaignId(BigDecimal campaignId) {
    this.campaignId = campaignId;
  }


  public NegativeTargetingClauseEx adGroupId(BigDecimal adGroupId) {
    
    this.adGroupId = adGroupId;
    return this;
  }

   /**
   * The identifier of the ad group to which this negative target is associated.
   * @return adGroupId
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The identifier of the ad group to which this negative target is associated.")

  public BigDecimal getAdGroupId() {
    return adGroupId;
  }


  public void setAdGroupId(BigDecimal adGroupId) {
    this.adGroupId = adGroupId;
  }


  public NegativeTargetingClauseEx state(State state) {
    
    this.state = state;
    return this;
  }

   /**
   * Get state
   * @return state
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public State getState() {
    return state;
  }


  public void setState(State state) {
    this.state = state;
  }


  public NegativeTargetingClauseEx expression(List<TargetingExpressionPredicate> expression) {
    
    this.expression = expression;
    return this;
  }

  public NegativeTargetingClauseEx addExpressionItem(TargetingExpressionPredicate expressionItem) {
    if (this.expression == null) {
      this.expression = new ArrayList<TargetingExpressionPredicate>();
    }
    this.expression.add(expressionItem);
    return this;
  }

   /**
   * The negative targeting expression.
   * @return expression
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The negative targeting expression.")

  public List<TargetingExpressionPredicate> getExpression() {
    return expression;
  }


  public void setExpression(List<TargetingExpressionPredicate> expression) {
    this.expression = expression;
  }


  public NegativeTargetingClauseEx resolvedExpression(List<TargetingExpressionPredicate> resolvedExpression) {
    
    this.resolvedExpression = resolvedExpression;
    return this;
  }

  public NegativeTargetingClauseEx addResolvedExpressionItem(TargetingExpressionPredicate resolvedExpressionItem) {
    if (this.resolvedExpression == null) {
      this.resolvedExpression = new ArrayList<TargetingExpressionPredicate>();
    }
    this.resolvedExpression.add(resolvedExpressionItem);
    return this;
  }

   /**
   * The resolved targeting expression.
   * @return resolvedExpression
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The resolved targeting expression.")

  public List<TargetingExpressionPredicate> getResolvedExpression() {
    return resolvedExpression;
  }


  public void setResolvedExpression(List<TargetingExpressionPredicate> resolvedExpression) {
    this.resolvedExpression = resolvedExpression;
  }


  public NegativeTargetingClauseEx expressionType(ExpressionType expressionType) {
    
    this.expressionType = expressionType;
    return this;
  }

   /**
   * Get expressionType
   * @return expressionType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public ExpressionType getExpressionType() {
    return expressionType;
  }


  public void setExpressionType(ExpressionType expressionType) {
    this.expressionType = expressionType;
  }


  public NegativeTargetingClauseEx creationDate(BigDecimal creationDate) {
    
    this.creationDate = creationDate;
    return this;
  }

   /**
   * The epoch time that the negative targeting clause was created.
   * @return creationDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The epoch time that the negative targeting clause was created.")

  public BigDecimal getCreationDate() {
    return creationDate;
  }


  public void setCreationDate(BigDecimal creationDate) {
    this.creationDate = creationDate;
  }


  public NegativeTargetingClauseEx lastUpdatedDate(BigDecimal lastUpdatedDate) {
    
    this.lastUpdatedDate = lastUpdatedDate;
    return this;
  }

   /**
   * The epoch time that the negative targeting clause was updated.
   * @return lastUpdatedDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The epoch time that the negative targeting clause was updated.")

  public BigDecimal getLastUpdatedDate() {
    return lastUpdatedDate;
  }


  public void setLastUpdatedDate(BigDecimal lastUpdatedDate) {
    this.lastUpdatedDate = lastUpdatedDate;
  }


  public NegativeTargetingClauseEx servingStatus(ServingStatusEnum servingStatus) {
    
    this.servingStatus = servingStatus;
    return this;
  }

   /**
   * The computed status of the negative targeting clause. See the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) for more information.
   * @return servingStatus
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The computed status of the negative targeting clause. See the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) for more information.")

  public ServingStatusEnum getServingStatus() {
    return servingStatus;
  }


  public void setServingStatus(ServingStatusEnum servingStatus) {
    this.servingStatus = servingStatus;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    NegativeTargetingClauseEx negativeTargetingClauseEx = (NegativeTargetingClauseEx) o;
    return Objects.equals(this.targetId, negativeTargetingClauseEx.targetId) &&
        Objects.equals(this.campaignId, negativeTargetingClauseEx.campaignId) &&
        Objects.equals(this.adGroupId, negativeTargetingClauseEx.adGroupId) &&
        Objects.equals(this.state, negativeTargetingClauseEx.state) &&
        Objects.equals(this.expression, negativeTargetingClauseEx.expression) &&
        Objects.equals(this.resolvedExpression, negativeTargetingClauseEx.resolvedExpression) &&
        Objects.equals(this.expressionType, negativeTargetingClauseEx.expressionType) &&
        Objects.equals(this.creationDate, negativeTargetingClauseEx.creationDate) &&
        Objects.equals(this.lastUpdatedDate, negativeTargetingClauseEx.lastUpdatedDate) &&
        Objects.equals(this.servingStatus, negativeTargetingClauseEx.servingStatus);
  }

  @Override
  public int hashCode() {
    return Objects.hash(targetId, campaignId, adGroupId, state, expression, resolvedExpression, expressionType, creationDate, lastUpdatedDate, servingStatus);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class NegativeTargetingClauseEx {\n");
    sb.append("    targetId: ").append(toIndentedString(targetId)).append("\n");
    sb.append("    campaignId: ").append(toIndentedString(campaignId)).append("\n");
    sb.append("    adGroupId: ").append(toIndentedString(adGroupId)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    expression: ").append(toIndentedString(expression)).append("\n");
    sb.append("    resolvedExpression: ").append(toIndentedString(resolvedExpression)).append("\n");
    sb.append("    expressionType: ").append(toIndentedString(expressionType)).append("\n");
    sb.append("    creationDate: ").append(toIndentedString(creationDate)).append("\n");
    sb.append("    lastUpdatedDate: ").append(toIndentedString(lastUpdatedDate)).append("\n");
    sb.append("    servingStatus: ").append(toIndentedString(servingStatus)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

